Fix/handling hierarchy#32
Open
TDannhauer wants to merge 7 commits into
Open
Conversation
Add handling for missing hierarchy sync key during PING.
Updated hierarchy check and added folder resync logic for collections. Enhanced pingable collections handling and added logging for missing folder cache entries.
Refactor PING request handling to improve collection loading logic and status codes.
Member
|
This PR is part of a companion pair: horde/nag#25 invalidates hierarchy (sets hierarchy = '0') when task lists change on the web; #32 makes PING On #32 itself: the '0' sentinel convention introduced here isn't documented in SyncCache! The restorePingableCollectionsFromCache() method may re-enable Also not ideal: No test coverage for the new logic. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Request FolderSync when hierarchy is invalid during PING
Summary
When the server invalidates the folder hierarchy synckey in the device sync cache (for example after task list or calendar folder changes in a groupware app), clients were only forced to run FolderSync on the next SYNC request. PING could continue for minutes without telling the device to refresh its folder hierarchy, so new or removed folders did not appear until the user triggered an unrelated sync (e.g. editing a task).
This change aligns PING with the existing SYNC behaviour (ActiveSync 12.1+): if
haveHierarchy()is false, return FolderSync required instead of waiting inpollForChanges().Changes
lib/Horde/ActiveSync/Request/Ping.phpBefore entering the PING wait loop, if the device protocol version is ≥ 12.1 and the sync cache has no valid hierarchy synckey (
!haveHierarchy()), respond immediately with PING status 7 (STATUS_FOLDERSYNCREQD) and stop processing.This mirrors the check already present at the start of
Horde_ActiveSync_Request_SyncforSTATUS_FOLDERSYNC_REQUIRED(12).lib/Horde/ActiveSync/Collections.phpAt the beginning of
pollForChanges(), if the device is ≥ 12.1 andhaveHierarchy()is false, returnCOLLECTION_ERR_FOLDERSYNC_REQUIREDso any PING path that reaches the poll loop also terminates with FolderSync required (same outcome as the explicit handling inPing.php).Why version ≥ 12.1
The hierarchy synckey in
Horde_ActiveSync_SyncCacheand the associated status codes are part of the ActiveSync 12.1 folder hierarchy model. Older clients use a different folder sync flow; Horde already gates the SYNC-side check onVERSION_TWELVEONE('12.1'). Both Ping.php and Collections.php use the same guard so clients ≤ 12.0 are unchanged.Behaviour notes
hierarchyvalue to empty/'0'(seeSyncCache::__isset/haveHierarchy()), not clearing the folder cache.COLLECTION_ERR_FOLDERSYNC_REQUIREDwere already handled inPing.php; this change ensures the condition is detected before a long heartbeat wait.COLLECTION_ERR_STALE) only ends PING early; it does not instruct the client to run FolderSync.Test plan
FolderHierarchy:Add/Removeas appropriate.Related work
Companion changes in Nag (separate PR): web-side task list create/delete updates
sync_listsand invalidates hierarchy without pruning device folder cache before FolderSync.